# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Alexander Fehr <pizzapunk gmail com>

pkgname=tracker
pkgver=2.3.6+r7+gb27396252
pkgrel=2
epoch=1
pkgdesc="Desktop-neutral user information store, search tool and indexer"
url="https://wiki.gnome.org/Projects/Tracker"
arch=(x86_64)
license=(GPL)
depends=(sqlite icu glib2 libffi util-linux libstemmer libseccomp json-glib
         libsoup upower libnm)
makedepends=(gobject-introspection vala git bash-completion meson)
checkdepends=(python-gobject python-dbus)
provides=(libtracker-{control,miner,sparql}-2.0.so)
_commit=b2739625209c564192b339814264084046e1cf17  # tracker-2.3
source=("git+https://gitlab.gnome.org/GNOME/tracker.git#commit=$_commit"
        0001-libtracker-data-Workaround-SQLite-3.35.x-bug.patch)
sha256sums=('SKIP'
            '2dc030fb047e99420bd330d5eee1fd70bd26a7ee0adf31f90c724bd0732ed67d')

pkgver() {
  cd tracker
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd tracker

  # https://gitlab.gnome.org/GNOME/tracker/-/merge_requests/382
  git apply -3 ../0001-libtracker-data-Workaround-SQLite-3.35.x-bug.patch
}

build() {
  arch-meson tracker build
  meson compile -C build
}

check() {
  dbus-run-session meson test -C build --print-errorlogs -t 3
}

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 et:
